<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta charset="utf-8">
    <title>Available Truck Page</title>
<?php echo link_tag(my_url().'skin.css'); ?>
<script type="text/javascript" src="<?php echo my_url(); ?>js/1.js"></script>
<script type="text/javascript" src="../js/1.js"></script>
<script src="<?php echo my_url(); ?>js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="<?php echo my_url(); ?>js/trhighlight.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
 var BaseURL='<?php echo base_url(); ?>';
function confirmDelete(at_id){
	
	var x= window.confirm("Are you sure to delete this item?");
	if(x){
		window.location.href = BaseURL + "at/delete_at/" + at_id;
	}	
}

</script>

<link rel="stylesheet" href="../skin.css" type="text/css" media="screen" /><meta name="author" content="Jaypee Mahilum" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link href="skin.css" rel="stylesheet" type="text/css" />
</head>

<?php



//echo $_SESSION['administrator_log']."============";
if(!isset($_SESSION['administrator_log']))
{
		echo"Log in first to access this page<html><title>WARNING</title><body><br><a href='".base_url()."administrator' />click here to log in.</a></body></html>";
}
else
{
?>

<?php
if(isset($debug))
{
	echo "<h2> $debug </h2>";
	exit;
}

?>
     
<body >


	<div class="BodyCoverat1">
	 		<div class="ParentContentat1">
	        <?php require("at_menu.php"); ?>
			<div class="MenuTab">
    			<div class="MenuBelow">
                    <div class="mbg"></div>
                 </div>        
             </div>
	   <div class="title">
			   <h1>Available Truck List:</h1>
       </div>                      
			<div class="module-indexat1">
		  		<div align="right"><a href="<?php echo base_url()?>admin/logout" style="color:#FF0000;">logout</a></div>
  	                <?php if (isset($recordflag)) {echo $recordflag;}?>
                
                		 <a href="<?php echo base_url() . "at_l_d/add_at_l_d/" ?>">
         	<img src=" <?php echo my_url() ."images/icons/action_add.gif" ?>" style='border:none'/> Add New Data</a><br />
          
          	<fieldset>
			<div class="at-search-wrapper">
                <div class="search_at">
            	<form action="<?php echo base_url(); ?>at_l_d/SearchDdlistsort" method="post">
					<label><b>Search</b></label>
                    <input type="text" name="search_value" id="search_value" value="" size="20" />
					
					<label><b>by:</b></label>
						<select id="column_value" name="column_value">
						
							<?php if(isset($column_value)) {?>
								<?php if ($column_value=='') {?>
									<option value="" selected='selected'></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									
							
																
								<?php } if ($column_value=='load_no') {?>
									<option value=""></option>	
									<option value="load_no" selected='selected'>Load No</option>
								
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
															
																								
								<?php } if ($column_value=='drop_off_city') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
								
									<option value="drop_off_city" selected='selected'>City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
							
															
								<?php } if ($column_value=='drop_off_state') {?>	
									<option value=""></option>	
									<option value="load_no">Load No</option>
							
									<option value="drop_off_city">City</option>
									<option value="drop_off_state" selected='selected'>State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
																							
								<?php }if ($column_value=='drop_off_date'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  selected='selected'>Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
							
							
																		
								<?php }if ($column_value=='type_of_truck'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
							
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck" selected='selected'>Type of Truck</option>
									<option value="status">status</option>
							
									
								<?php }if ($column_value=='status'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
							
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date" >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status"  selected='selected'>status</option>
																							
																
								<?php }} else {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>

									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									
								<?php } ?>
						</select> 
					<input type="submit" value="Search" id="Search" />
				</form>
                </div>
                
                <div class="sort_at">
		            	<form action="<?php echo base_url(); ?>at_l_d/ddlistsort" method="post">
								
					<label><b>Sort by:</b></label>
						<select id="sort" name="sort">
						
							<?php if(isset($sort)) {?>
								<?php if ($sort=='') {?>
									<option value="" selected='selected'></option>	
									<option value="load_no">Load No</option>

									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
																
								<?php } if ($sort=='load_no') {?>
									<option value=""></option>	
									<option value="load_no" selected='selected'>Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
								
																	
								<?php } if ($sort=='drop_off_city') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>

									<option value="drop_off_city" selected='selected'>City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
															
								<?php } if ($sort=='drop_off_state') {?>	
									<option value=""></option>	
									<option value="load_no">Load No</option>

									<option value="drop_off_city">City</option>
									<option value="drop_off_state" selected='selected'>State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
																
								<?php }if ($sort=='drop_off_date'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  selected='selected'>Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
																		
								<?php }if ($sort=='type_of_truck'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck" selected='selected'>Type of Truck</option>
									<option value="status">status</option>

								<?php }if ($sort=='status'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date" >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status"  selected='selected'>status</option>
																	
 																
								<?php }} else {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									
								<?php } ?>
						</select> 
									
					<input type="submit" value="Go" id="Search" />
				 </form>
                 </div>
			     </div>
			</fieldset>
                <table class='Grid' width='1275px' border='1'>
                  	<tr>
                    
                            <th nowrap="nowrap" id="ldth" align="center" >Ed</th>
                            <th nowrap="nowrap" id="ldth" align="center" >Dt</th> 
                            <th nowrap="nowrap" id="ldth" align="center" >Nickname</th>
                            <th nowrap="nowrap" id="ldth" align="center" >Date</th>
                            <th nowrap="nowrap" id="ldth" align="center" colspan="2">Current Location</th>
                            <th nowrap="nowrap" id="ldth" align="center">Destination(s) </th>
                             <th nowrap="nowrap" id="ldth" align="center">Equipment Type </th>
                            <th nowrap="nowrap" id="ldth" align="center">Current Statues</th>
                        </tr>
<?php
        		  $_rowClass = 'tr_odd';
                foreach($list_at_l_d as $row)
                {
                         $f_name = $row->f_name;
 						 $drop_off_city = $row->drop_off_city;
						 $drop_off_state = $row->drop_off_state;
						 $drop_off_date = $row->drop_off_date;
						 $des_zone = $row->des_zone;		
						 $type_of_truck = $row->type_of_truck;		
						 $status = $row->status;		
						 				 						 
?>					
					<tr class="<?php echo $_rowClass ?>"<?php echo GetTrEffects()?>>
						 	<td width='5'>
                        	<a href="<?php echo base_url() . "at_l_d/edit_at_l_d/" . $row->at_id ?>">
                            	<img src="<?php echo my_url() . "images/icons/edit.gif" ?>" style='border:none' />
                             </a>
							</td>
                            
                             <td width='5'>
                            	<a href="javascript:void(0)" onclick="confirmDelete(<?php echo $row->at_id ?>);" >
								<img src="<?php echo my_url() . "images/icons/delete.gif" ?>" style='border:none' />
							</a>
						</td>
                             <td id="ld" ><?php echo $f_name?></td>
                            <td nowrap="nowrap" id="ld" ><?php echo $drop_off_date ?></td>
                            <td nowrap="nowrap" id="ld" colspan="2" >
                            <?php echo $drop_off_city ?>, <?php echo $drop_off_state ?></td>
                            <td nowrap="nowrap" id="ld" ><?php echo $des_zone ?></td>
                            <td nowrap="nowrap" id="ld" ><?php echo $type_of_truck; ?></td>
                            <td nowrap="nowrap" id="ld" ><?php echo $status; ?></td>
                  </tr>
<?php                  
				  if($_rowClass=="tr_odd") $_rowClass="tr_even"; else $_rowClass="tr_odd";     
                 }
?>
                 </table>
                
		</div><!---end of ParentContent ---->
    <div class="Footer1">	
                <div class="Footer">Copyright &copy; 2011. All Rights Reserved <br><br>
                 <a href="http://webmartis.com"> <img src="<?php echo my_url();?>/images/wmlink.png"></a>
                 
                </div>                
            </div> <!---end of Footer1 ---->        
        
    </div> <!---end of BodyCover ---->
 
</body>
<?php } ?>
</html>

